/**
 * @author zhaozhenjiang
 * 创建数据库软件安装响应文件
 * */

package com.auto.oracle;

final class createDbPfile {
	private createFile pfile = null;
	private createParams para = null;
	public createDbPfile(String base_path,String resp_name,createParams para){
		pfile = new createFile(base_path, resp_name);
		this.para = para;
	}
	
	public void createFile(){
		pfile.init();
		pfile.append("db_name='" + para.getInstanceName() + "'");
		pfile.append("memory_target=" + para.getOracleMem() + "M");
		pfile.append("processes=" + para.getProcess());
		pfile.append("audit_file_dest='" + para.getOraclePath() + "/app/oracle/admin/" + para.getInstanceName() + "/adump'");
		pfile.append("audit_trail ='db'");
		pfile.append("db_block_size=8192");
		pfile.append("db_domain=''");
		pfile.append("db_recovery_file_dest='" + para.getOraclePath() + "/app/oracle/flash_recovery_area'");
		pfile.append("db_recovery_file_dest_size=2G");
		pfile.append("diagnostic_dest='" + para.getOraclePath() + "/app/oracle'");
		pfile.append("dispatchers='(PROTOCOL=TCP) (SERVICE=" + para.getInstanceName() + "XDB)'");
		pfile.append("open_cursors=300");
		pfile.append("remote_login_passwordfile='EXCLUSIVE'");
		pfile.append("undo_tablespace='UNDOTBS1'");
		pfile.append("control_files=(" + para.getOraclePath() + "/app/oracle/oradata/" + para.getInstanceName() + "/control01.ctl, " + para.getOraclePath() + "/app/oracle/oradata/" + para.getInstanceName() + "/control02.ctl)");
		pfile.append("compatible='" + para.getVersion() + "'");
		pfile.close();
		pfile = null;
	}	

	@SuppressWarnings("unused")
	private class Decompile{
		
	}
}
